/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import {apiPrefixDispose} from '@/utils/format';
import {request} from '@umijs/max';


/**
 * 分页查询域名
 */
export async function pageDomain<T = any>(body: API.DomainPage) {
  return request<API.ResultPageVO<API.Domains>>(apiPrefixDispose('/nginx/ssl/pageDomain'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}


/**
 * 注册需要监控的域名
 */
export async function registerDomain<T = any>(body: API.DomainRegister) {
  return request<API.ResultVO<API.Domains>>(apiPrefixDispose('/nginx/ssl/registerDomain'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}



/**
 * 域名证书校验
 * @param  domain 域名 【不要写https://】
 */
export async function sslVerify<T = any>(
  domain: string,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/verify'), {
    method: 'GET',
    params: { 'domain':domain },
    ...(options || {}),
  });
}



/**
 * 删除域名
 */
export async function deleteDomain<T = any>(
  id: number,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose(`/nginx/ssl/deleteDomain`), {
    method: 'GET',
    params: {'id':id},
    ...(options || {}),
  });
}

/**
 * 域名设置webhook
 */
export async function webhook<T = any>(
  params: API.SettingWebhook,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/webhook'), {
    method: 'GET',
    params: { ...params },
    ...(options || {}),
  });
}

/**
 * 域名设置access
 */
export async function access<T = any>(
  params: API.SettingAccess,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/access'), {
    method: 'GET',
    params: { ...params },
    ...(options || {}),
  });
}

/**
 * 域名设置SSH
 */
export async function ssh<T = any>(
  params: API.SettingSSH,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/ssh'), {
    method: 'GET',
    params: { ...params },
    ...(options || {}),
  });
}

/**
 * webhook 通知用户域名状态
 */
export async function webhookNotification<T = any>(
  params: number,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/webhook/notification'), {
    method: 'GET',
    params: { 'id':params },
    ...(options || {}),
  });
}

/**
 * 设置sslpath
 */
export async function settingSslPath<T = any>(body: API.SettingSslPath) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/sslPath'), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
  });
}

/**
 * 域名证书下载
 */
export async function downloadSsl<T = any>(
  params: number,
  options?: { [key: string]: any },
) {
  return request<any>(apiPrefixDispose('/nginx/ssl/download'), {
    method: 'GET',
    params: { 'id':params },
    ...(options || {}),
  });
}



/**
 * 域名证书部署
 */
export async function buildSsl<T = any>(
  params: number,
  options?: { [key: string]: any },
) {
  return request<API.ResultVO<string>>(apiPrefixDispose('/nginx/ssl/build'), {
    method: 'GET',
    params: { 'id':params },
    ...(options || {}),
  });
}
